import React,{ Component } from "react";


export default class Hello extends Component{
    constructor(props) {
        super(props)
        console.log("Hello  constructor   -1");
        this.state = {
            count: 0
        }
    }

    add = () => {
        this.setState({
            count: ++this.state.count
        })
    }

    componentWillMount() {
        console.log("Hello  componentWillMount  -2")
    }
    render() {
        const { count } = this.state
        console.log("Hello   render  -3")
        return (
            <div>
              <button onClick={this.add}>add</button>
              <div>{count}</div>
            </div>
        )
    }

    componentDidMount() {
        console.log("Hello  componentDidMound  -4")
    }
}

// export default function Hello() {
  

//     return (
//         <div>
          
//         </div>
//     )
// }